﻿(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define(['jquery', 'use!underscore', 'use!backbone', 'views/album', 'views/photo', 'views/addPhoto'], function($, _, Backbone, AlbumView, PhotoView, AddView) {
    var AppRouter;
    AppRouter = (function(_super) {

      __extends(AppRouter, _super);

      function AppRouter() {
        return AppRouter.__super__.constructor.apply(this, arguments);
      }

      AppRouter.prototype.routes = {
        '': 'album',
        'Photo': 'photo',
        'Photo/Create': 'addPhoto'
      };

      AppRouter.prototype.album = function() {
        return AlbumView.render().el;
      };

      AppRouter.prototype.photo = function() {
        return PhotoView.render().el;
      };

      AppRouter.prototype.addPhoto = function() {
        var newView;
        newView = new AddView();
        return $('.photo:first').before(newView.render('edit').el);
      };

      return AppRouter;

    })(Backbone.Router);
    return new AppRouter();
  });

}).call(this);
